import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
import CameraView from '../views/CameraView.vue'
import BluetoothView from '../views/BluetoothView.vue'
import LocalNotificationView from '../views/LocalNotificationView.vue'

const routes = [
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/login/index.vue'),
        meta: {
            title: '登录',
            position: [''],
        }
    },
    {
        path: '/',
        redirect: '/home',
    },
    {
        path: '/home',
        name: 'home',
        component: HomeView,
        meta: {
            title: '首页',
            showInTabbar: true,
            showInNav: true
        }
    },
    {
        path: '/camera',
        name: 'camera',
        component: CameraView,
        meta: {
            title: '相机',
            position: ['about'],
            showInNav: true,
            showBackButton: true
        }
    },
    {
        path: '/bluetooth',
        name: 'bluetooth',
        component: BluetoothView,
        meta: {
            title: '蓝牙',
            position: ['about'],
            showInNav: true,
            showBackButton: true
        }
    },
    {
        path: '/notification',
        name: 'notification',
        component: LocalNotificationView,
        meta: {
            title: '通知',
        }
    },
    {
        path: '/about',
        name: 'about',
        component: ()=>import('@/views/about/index.vue'),
        meta: {
            title: '关于',
            showInTabbar: true,
            showInNav: true
        }
    },
    {
        path: '/notify',
        name: 'notify',
        component: ()=>import('@/views/notify/index.vue'),
        meta: {
            title: '通知',
            showInTabbar: true,
            showInNav: true
        }
    },
    {
        path: '/my',
        name: 'my',
        component: ()=>import('@/views/my/index.vue'),
        meta: {
            title: '我的',
            showInTabbar: true,
            showInNav: true
        }
    }
]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes
})

export default router

